package com.huawei.appmarket.service.deeplink.activity;

import android.content.Context;
import android.text.TextUtils;
import com.huawei.appgallery.foundation.service.common.protocol.AppDetailActivityProtocol;
import com.huawei.appgallery.foundation.service.common.protocol.AppDetailActivityProtocol.Request;
import com.huawei.appmarket.service.thirdappdl.ThirdAppDownloadActivity;
import com.huawei.appmarket.service.thirdappdl.ThirdAppDownloadActivityProtocol;
import o.cjk;
import o.cjm;
import o.cjo;
import o.Logger;
import o.drj;
import o.dws;
import o.dws.d;
import o.dwv;

public class DeeplinkDownloadActivity extends ThirdAppDownloadActivity implements d {
    private String ˏॱ;
    private String ͺ;

    public void ᐝ() {
        ThirdAppDownloadActivityProtocol thirdAppDownloadActivityProtocol = (ThirdAppDownloadActivityProtocol) ʾ();
        if (thirdAppDownloadActivityProtocol == null) {
            Logger.e("DeeplinkDownloadActivity", "arguments is null!!!");
            finish();
            return;
        }
        this.ˏॱ = thirdAppDownloadActivityProtocol.ˊ().ˎ();
        this.ͺ = thirdAppDownloadActivityProtocol.ˊ().ॱˊ();
    }

    public void ॱॱ() {
        if (dwv.ˊ(this.ˊॱ)) {
            new dws(this, this.ˊॱ, this.ˏॱ, this).ˏ((Context) this);
        } else {
            ˈ();
        }
    }

    private void ˈ() {
        if (TextUtils.isEmpty(this.ˋॱ)) {
            Logger.ˋ("DeeplinkDownloadActivity", "empty jump url,finish");
            finish();
            return;
        }
        int ˋ = dwv.ˋ((Context) this, this.ˏॱ, this.ˊॱ, this.ˋॱ);
        if (ˋ == -2) {
            finish();
            return;
        }
        if (ˋ == -1) {
            Logger.ˋ("DeeplinkDownloadActivity", "jump failed, turn to detail activity");
            cjo appDetailActivityProtocol = new AppDetailActivityProtocol();
            appDetailActivityProtocol.ˏ(new Request(drj.ॱ(this.ˊॱ), this.ͺ));
            cjk.ˎ().ˋ(this, new cjm("appdetail.activity", appDetailActivityProtocol));
        }
        dwv.ˏ(this, this.ˏॱ, this.ˊॱ, this.ˋॱ, ˋ);
        finish();
    }

    public void aj_() {
        ˈ();
    }

    public void ak_() {
        Logger.ˎ("DeeplinkDownloadActivity", "user cancel jump");
        finish();
    }
}
